<template>
	<view class="flex justify-between">
		<view v-if="signBase64">
			<u--image width="380rpx" height="154rpx" :src="signTempimg"></u--image>
		</view>
		<view @tap="gotoSign">
			<u--image width="152rpx" height="152rpx" src="/static/images/ui/salary/check.png"></u--image>
		</view>
	</view>
</template>

<script>
	import upload from "@/utils/upload.js"
	export default {
		name:"bg-sign",
		data() {
			return {
				signBase64: '',
				signTempimg: ''
			};
		},
		methods:{
			gotoSign(){
				uni.navigateTo({
					url:"/pages/common/sign/sign",
					success: () => {
					  uni.$once('getSignImg', (e) => {
					    // console.log('getSignImg', e)
					    if (e.sid == 'sign-board') {
							
							upload({filePath: e.path}).then(res=>{
								if(res.code==200){
									this.signBase64 = e.base64
									this.signTempimg = e.path
									Object.assign(e, res.data)
									this.$emit("sign-success", e)
								}
							})
					    }
					  })
					}
				})
			}
		}
	}
</script>

<style>

</style>